package com.liyuhan;

/**
 * Created by 李宇寒
 * Description:
 * 2019/6/28 0028 上午 10:07.
 */
import java.io.*;
import java.math.*;
import java.util.*;
public class TestSon{

    public static void main(String []args){
        Scanner sc = new Scanner(new BufferedInputStream(System.in));

        BigInteger bigone = sc.nextBigInteger();
        BigInteger devision = sc.nextBigInteger();

        sc.close();

        BigInteger []result = bigone.divideAndRemainder(devision);

        System.out.println(result[0] + " " + result[1]);
    }
}
